#include<iostream>
#include<cstdio>
#include<algorithm>
#include<queue>
#define ll long
#define For(i,x,j)  for(ll (i)=(x);(i)<=(j);++(i))
using namespace std;
inline ll rea(){
	ll t=1,c=0;char x=getchar();
	while(x<'0'||x>'9'){if(x=='-')	t=-1;x=getchar();}
	while(x>='0'&&x<='9'){c=c*10+x-'0';x=getchar();}
	return t*c;
}
ll n,T,ans,a[510000],p,b[510000];
ll l1,r1,o;
string an;
vector<char>c;
bool hw(ll x){
	for(ll i=x,j=i+1;i>=1&&j<=2*x;--i,++j){
		if(a[i]!=a[j])	return 0;
	}
	return 1;
}
bool hw1(ll x){
	for(ll i=x,j=i+1;i>=1&&j<=2*x;--i,++j){
		if(b[i]!=b[j])	return 0;
	}
	return 1;
}
void dfs(ll t){//am,ysbl
	if(t==0){
		if(hw1(n))	{
			p=1;string s;
			for(ll i=0;i<c.size();i++)	s=s+c[i];
			if(an.empty())	an=s;
			if(s<an)	an=s;
		}
		return ;
	}
	if(l1<=n)	{
		b[++o]=a[l1];
		l1++;c.push_back('L');
		dfs(t-1);
		l1--;o--;c.erase(c.end()-1);
	}
	if(r1>n&&!p){
		b[++o]=a[r1];
		r1--;c.push_back('R');
		dfs(t-1);
		r1++;o--;c.erase(c.end()-1);
	}
}
int main(){
	freopen("palin.in","r",stdin);
	freopen("palin.out","w",stdout);
	T=rea();
	while(T--){
		n=rea();p=0;
		For(i,1,2*n)	a[i]=rea();
		if(n<=10)	{
			l1=1,r1=2*n;
			dfs(r1);
			if(p)	cout<<an<<endl;
			else	cout<<-1<<endl;
			an.clear();
			continue;
		}
		if(hw(n)){
			For(i,1,2*n)	cout<<'L';
			cout<<endl;continue;
		}
	}
	return 0;
}

